@extends('admin.layout')
@section('content')
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        <div class="col-md-12" id="content">
            <div class="app_content_div" id="app_content_div_301Index">
                <h3>管理员用户列表</h3>
            </div>
            <div>
                <div style="float:right;">
                    <button type="button" class="btn btn-primary" onclick="window.location.href='/adm/user/add-user'">添加管理员</button>
                </div>
            </div>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>id</th>
                    <th>用户名</th>
                    <th>更改密码</th>
                    <th>删除</th>
                </tr>
                </thead>
                <tbody>
                @foreach($users as $v)
                    <tr>
                        <td>{{$v->id}}</td>
                        <td>{{$v->name}}</td>
                        <td>
                            <form action="/adm/user/destroy/{{$v->id}}" method="post">
                                @csrf
                                @method('DELETE')
                                <a href="/adm/user/change-password/{{$v->id}}">更改密码</a>
                                <td><button type="submit" class="btn-danger">删除</button></td>

                            </form>

                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>

@endsection
